home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / m68k / cc68k.arc / C.H < prev    next >
C/C++ Source or Header  |  1986-10-26  |  4KB  |  121 lines

  1.  /*
  2.  *    68000 C compiler
  3.  *
  4.  *    Copyright 1984, 1985, 1986 Matthew Brandt.
  5.  *  all commercial rights reserved.
  6.  *
  7.  *    This compiler is intended as an instructive tool for personal use. Any
  8.  *    use for profit without the written consent of the author is prohibited.
  9.  *
  10.  *    This compiler may be distributed freely for non-commercial use as long
  11.  *    as this notice stays intact. Please forward any enhancements or question
  12. s
  13.  *    to:
  14.  *
  15.  *        Matthew Brandt
  16.  *        Box 920337
  17.  *        Norcross, Ga 30092
  18.  */
  19.  
  20. /*      compiler header file    */
  21.  
  22. enum e_sym {
  23.         id, cconst, iconst, lconst, sconst, rconst, plus, minus,
  24.         star, divide, lshift, rshift, modop, eq, neq, lt, leq, gt,
  25.         geq, assign, asplus, asminus, astimes, asdivide, asmodop,
  26.         aslshift, asrshift, asand, asor, autoinc, autodec, hook, compl,
  27.         comma, colon, semicolon, uparrow, openbr, closebr, begin, end,
  28.         openpa, closepa, pointsto, dot, lor, land, not, or, and, kw_int,
  29.         kw_void, kw_char, kw_float, kw_double, kw_struct, kw_union,
  30.         kw_long, kw_short, kw_unsigned, kw_auto, kw_extern,
  31.         kw_register, kw_typedef, kw_static, kw_goto, kw_return,
  32.         kw_sizeof, kw_break, kw_continue, kw_if, kw_else, kw_for,
  33.         kw_do, kw_while, kw_switch, kw_case, kw_default, kw_enum,
  34.         eof };
  35.  
  36. enum e_sc {
  37.         sc_static, sc_auto, sc_global, sc_external, sc_type, sc_const,
  38.         sc_member, sc_label, sc_ulabel };
  39.  
  40. enum e_bt {
  41.         bt_char, bt_short, bt_long, bt_float, bt_double, bt_pointer,
  42.         bt_unsigned, bt_struct, bt_union, bt_enum, bt_func, bt_ifunc};
  43.  
  44. struct slit {
  45.         struct slit     *next;
  46.         int             label;
  47.         char            *str;
  48.         };
  49.  
  50. struct sym {
  51.         struct sym      *next;
  52.         char            *name;
  53.         int               storage_class;
  54.         union   {
  55.                 long            i;
  56.                 unsigned        u;
  57.                 double          f;
  58.                 char            *s;
  59.                 }
  60.                         value;
  61.  
  62.         struct typ {
  63.                 int               type;
  64.                 char            val_flag;       /* is it a value type */
  65.                 long            size;
  66.                 struct stab {
  67.                         struct sym      *head, *tail;
  68.                         }       lst;
  69.                 struct typ      *btp;
  70.                 char            *sname;
  71.                 }
  72.                         *tp;
  73.         };
  74.  
  75. #define SYM     struct sym
  76. #define TYP     struct typ
  77. #define TABLE   struct stab
  78.  
  79. #define MAX_STRLEN      120
  80. #define MAX_STLP1       121
  81. #define ERR_SYNTAX      0
  82. #define ERR_ILLCHAR     1
  83. #define ERR_FPCON       2
  84. #define ERR_ILLTYPE     3
  85. #define ERR_UNDEFINED   4
  86. #define ERR_DUPSYM      5
  87. #define ERR_PUNCT       6
  88. #define ERR_IDEXPECT    7
  89. #define ERR_NOINIT      8
  90. #define ERR_INCOMPLETE  9
  91. #define ERR_ILLINIT     10
  92. #define ERR_INITSIZE    11
  93. #define ERR_ILLCLASS    12
  94. #define ERR_BLOCK       13
  95. #define ERR_NOPOINTER   14
  96. #define ERR_NOFUNC      15
  97. #define ERR_NOMEMBER    16
  98. #define ERR_LVALUE      17
  99. #define ERR_DEREF       18
  100. #define ERR_MISMATCH    19
  101. #define ERR_EXPREXPECT  20
  102. #define ERR_WHILEXPECT  21
  103. #define ERR_NOCASE      22
  104. #define ERR_DUPCASE     23
  105. #define ERR_LABEL       24
  106. #define ERR_PREPROC     25
  107. #define ERR_INCLFILE    26
  108. #define ERR_CANTOPEN    27
  109. #define ERR_DEFINE      28
  110.  
  111. /*      alignment sizes         */
  112.  
  113. #define AL_CHAR         1
  114. #define AL_SHORT        2
  115. #define AL_LONG         2
  116. #define AL_POINTER      2
  117. #define AL_FLOAT        2
  118. #define AL_DOUBLE       2
  119. #define AL_STRUCT       2
  120.  
  121.